package com.easy.common.enumbean;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;

public enum InteractionType {
    MOBILE("手机"),
    EMAIL("邮箱"),
    MEETING("会议"),
    ORDER("订单"),
    OTHER("其他");

    @EnumValue
    private final String value;

    InteractionType(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    @JsonCreator
    public static InteractionType fromValue(String value) {
        for (InteractionType interactionType : values()) {
            if (interactionType.getValue().equals(value)) {
                return interactionType;
            }
        }
        return null;
    }
}